/**
 * 
 */
package com.scpii.universal.pns.dao.impl;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.scpii.universal.hibernate.dao.impl.BaseDaoImpl;
import com.scpii.universal.pns.dao.FieldDao;
import com.scpii.universal.pns.entity.Field;

/**
 * genericWeb
 * 
 * @author acer 2012-7-5下午04:35:11
 */
@Repository
public class FieldDaoImpl extends BaseDaoImpl<Field, Long> implements FieldDao {

	@Override
	public Field selectByField(Field field) {
		String hql = "FROM Field f WHERE f.name=:name AND f.appId=:appId";
		Query query = getSession().createQuery(hql);
		query.setParameter("name", field.getName());
		query.setParameter("appId", field.getAppId());
		return (Field) query.uniqueResult();
	}

}
